import com.sun.prism.impl.FactoryResetException;

import java.util.Scanner;

public class Work01 {
    // 质因数分解
    static int[] nums  = new int[40];
    static int[] counts = new int[40];

    static int factor(int n){
        int count = 0;
        for (int i = 2; i <= Math.sqrt(n); i++) {
            if(n % i == 0){
                nums[count] = i;
                counts[count] = 0;
                while(n % i == 0){
                    n /= i;
                    counts[count] += 1;
                }
                count++;
            }

        }
        if(n > 1){
            nums[count] = n;
            counts[count] = 1;
            count++;
        }
        return count;
    }
    public static void main(String[] args) {

        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int count = factor(n);
        for (int i = 0; i < count; i++) {

                System.out.println(nums[i]);

        }
        for (int i = 0; i < count; i++) {
            System.out.println(counts[i]);
        }
    }
}
